export class IParams {
    artifact?: string

    pipelineID!: number

    pipelineName!: string

    buildNumber?: number

    workSpace!: string

    projectDir!: string

    buildJobID!: string

    stepID!: string

    cacheType!: string

    cacheImageId?: string

    region!: string

    instance!: string

    namespace!: string

    dockerRegistry!: string

    dockerTag!: string

    useVpcAddress!: boolean

    dockerfilePath!: string

    contextPath?: string

    options?: string
}

export function getParams(): IParams {
    let params = new IParams()
    params.artifact = process.env.artifact as string
    params.pipelineID = Number(process.env.PIPELINE_ID)
    params.pipelineName = process.env.PIPELINE_NAME as string
    params.buildNumber = Number(process.env.BUILD_NUMBER)
    params.workSpace = process.env.WORK_SPACE as string
    params.projectDir = process.env.PROJECT_DIR as string
    params.buildJobID = process.env.BUILD_JOB_ID as string
    params.stepID = process.env.stepIdentifier as string
    params.cacheType = process.env.cacheType as string
    params.region = process.env.DOCKER_REGION as string
    params.instance = process.env.DOCKER_INSTANCE as string
    params.namespace = process.env.DOCKER_NAMESPACE as string
    params.dockerRegistry = process.env.DOCKER_REPO as string
    params.useVpcAddress = process.env.USE_VPC_ADDRESS === "true"
    params.dockerTag = process.env.DOCKER_TAG as string
    params.dockerfilePath = process.env.DOCKER_FILE_PATH as string
    params.contextPath = process.env.CONTEXT_PATH as string
    params.cacheImageId = process.env.cacheImageId as string
    params.options = process.env.options as string
    return params
}